
<%--
  Created by IntelliJ IDEA.
  User: Blank
  Date: 2020/10/22
  Time: 18:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/static/css/bootstrap-theme.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script  src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function Delete(sid){
        const flag = confirm("是否确定删除？");
        if(flag){

            location.href="delStudent?sid="+sid;
        }
    }
</script>
<head>
    <title>学生信息界面</title>
</head>
<style>
    .search{
        margin-left:450px;
        margin-top:30px;
    }
    .add {
        margin-left: 30px;
    }
    .add a{
        color: #fff;
        list-style: none;
    }
    .update a{
        color:#fff;
        list-style: none;
    }
    .delete a{
        color:#fff;
        list-style: none;
    }
</style>
<body>
<div>
    <%--    搜索框 --%>
    <div class="search">
        <form class="form-inline" action="searchStuInfo" method="post">
            <div class="form-group">
                <label class="sr-only">Amount (in dollars)</label>
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="name" name="sName">
                </div>
            </div>
            <button type="submit" class="btn btn-primary">查询</button>
            <%-- 新增按钮       --%>
            <button type="button" class="btn btn-primary add"><a href="addStudentInfo.jsp">新增</a></button>
        </form>
    </div>
    <div class="table">
        <table class="table table-responsive" id="myTable" style="color:SlateGray">
            <thead>
            <tr class="active" >
                <th></th>
                <th></th>
                <th >学号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>出生日期</th>
                <th>邮箱</th>
                <th>备注</th>
                <th>班级编号</th>
                <th>operation</th>
            </tr>

            <tbody>
            <c:forEach items = "${list}" var = "student">
                <tr class="info">
                    <td></td>
                    <td></td>
                    <td>${student.sid}</td>
                    <td>${student.sName}</td>
                    <td>${student.gender}</td>
                    <td>${student.sdate}</td>
                    <td>${student.email}</td>
                    <td>${student.remark}</td>
                    <td>${student.classId}</td>
                    <td>
                        <button type="button" class="btn btn-info update"><a href="updateServlet?sid=${student.sid}">修改</a></button>
                        <button type="button" class="btn btn-info delete"><a onclick="Delete(${student.sid})">删除</a></button>
                    </td>

                </tr>
            </c:forEach>
            </tbody>
            </thead>
        </table>
    </div>
</body>
</html>
